/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ve.com.cantv.worktables.ejb.entity;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.annotation.Generated;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Ghust
 */
@Entity
@Table(name = "activity")
@NamedQueries({@NamedQuery(name = "Activity.findAll", query = "SELECT a FROM Activity a"), @NamedQuery(name = "Activity.findByIdactivity", query = "SELECT a FROM Activity a WHERE a.idactivity = :idactivity"), @NamedQuery(name = "Activity.findByCompanie", query = "SELECT a FROM Activity a WHERE a.companie = :companie"), @NamedQuery(name = "Activity.findByName", query = "SELECT a FROM Activity a WHERE a.name = :name"), @NamedQuery(name = "Activity.findByPlace", query = "SELECT a FROM Activity a WHERE a.place = :place"), @NamedQuery(name = "Activity.findByObjetive", query = "SELECT a FROM Activity a WHERE a.objetive = :objetive"), @NamedQuery(name = "Activity.findByEndDate", query = "SELECT a FROM Activity a WHERE a.endDate = :endDate"), @NamedQuery(name = "Activity.findByStartDate", query = "SELECT a FROM Activity a WHERE a.startDate = :startDate"), @NamedQuery(name = "Activity.findByMinimunParticipants", query = "SELECT a FROM Activity a WHERE a.minimunParticipants = :minimunParticipants"), @NamedQuery(name = "Activity.findByOptimusParticipants", query = "SELECT a FROM Activity a WHERE a.optimusParticipants = :optimusParticipants"), @NamedQuery(name = "Activity.findByMaximunParticipants", query = "SELECT a FROM Activity a WHERE a.maximunParticipants = :maximunParticipants"), @NamedQuery(name = "Activity.findByStartTime", query = "SELECT a FROM Activity a WHERE a.startTime = :startTime")})
public class Activity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idactivity")
    @GeneratedValue(strategy=GenerationType.SEQUENCE)
    private Integer idactivity;
    @Basic(optional = false)
    @Column(name = "companie")
    private String companie;
    @Basic(optional = false)
    @Column(name = "name")
    private String name;
    @Column(name = "place")
    private String place;
    @Column(name = "objetive")
    private String objetive;
    @Column(name = "end_date")
    @Temporal(TemporalType.DATE)
    private Date endDate;
    @Column(name = "start_date")
    @Temporal(TemporalType.DATE)
    private Date startDate;
    @Column(name = "minimun_participants")
    private Integer minimunParticipants;
    @Column(name = "optimus_participants")
    private Integer optimusParticipants;
    @Column(name = "maximun_participants")
    private Integer maximunParticipants;
    @Column(name = "start_time")
    private String startTime;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idActivity")
    private Collection<ActivityFile> activityFileCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idActiviy",fetch=FetchType.EAGER)
    private Collection<ActivityToActivityParticipantType> activityToActivityParticipantTypeCollection;
    @JoinColumn(name = "idcategory", referencedColumnName = "id_category_activity")
    @ManyToOne
    private CategoryActivity idcategory;

    public Activity() {
    }

    public Activity(Integer idactivity) {
        this.idactivity = idactivity;
    }

    public Activity(Integer idactivity, String companie, String name) {
        this.idactivity = idactivity;
        this.companie = companie;
        this.name = name;
    }

    public Integer getIdactivity() {
        return idactivity;
    }

    public void setIdactivity(Integer idactivity) {
        this.idactivity = idactivity;
    }

    public String getCompanie() {
        return companie;
    }

    public void setCompanie(String companie) {
        this.companie = companie;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPlace() {
        return place;
    }

    public void setPlace(String place) {
        this.place = place;
    }

    public String getObjetive() {
        return objetive;
    }

    public void setObjetive(String objetive) {
        this.objetive = objetive;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Integer getMinimunParticipants() {
        return minimunParticipants;
    }

    public void setMinimunParticipants(Integer minimunParticipants) {
        this.minimunParticipants = minimunParticipants;
    }

    public Integer getOptimusParticipants() {
        return optimusParticipants;
    }

    public void setOptimusParticipants(Integer optimusParticipants) {
        this.optimusParticipants = optimusParticipants;
    }

    public Integer getMaximunParticipants() {
        return maximunParticipants;
    }

    public void setMaximunParticipants(Integer maximunParticipants) {
        this.maximunParticipants = maximunParticipants;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public Collection<ActivityFile> getActivityFileCollection() {
        return activityFileCollection;
    }

    public void setActivityFileCollection(Collection<ActivityFile> activityFileCollection) {
        this.activityFileCollection = activityFileCollection;
    }

    public Collection<ActivityToActivityParticipantType> getActivityToActivityParticipantTypeCollection() {
        return activityToActivityParticipantTypeCollection;
    }

    public void setActivityToActivityParticipantTypeCollection(Collection<ActivityToActivityParticipantType> activityToActivityParticipantTypeCollection) {
        this.activityToActivityParticipantTypeCollection = activityToActivityParticipantTypeCollection;
    }

    public CategoryActivity getIdcategory() {
        return idcategory;
    }

    public void setIdcategory(CategoryActivity idcategory) {
        this.idcategory = idcategory;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idactivity != null ? idactivity.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Actividfhbfdhty)) {
            return false;
        }
        Activity other = (Activity) object;
        if ((this.idactivity == null && other.idactivity != null) || (this.idactivity != null && !this.idactivity.equals(other.idactivity))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ve.com.cantv.worktables.ejb.entity.Activity[idactivity=" + idactivity + "]";
    }

}
